package org.example.controller;

import org.example.pojo.DemoPo;
import org.example.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class DemoController {
    @Autowired
    DemoService demoService;
    @GetMapping("/getdata")
    public List<DemoPo> getdata(){
        List<DemoPo> demoPos = demoService.getListData();
        return demoPos;
    }
}
